#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int main()
{
	//123
	//321

	//123
	//0*10+3

	//12
	//3*10+2

	//1
	//32*10+1
	
	//int n = 0;
	//int s = 0;
	//while (scanf("%d", &n) != EOF)
	//{
	//	s = 0;
	//	while (n != 0)
	//	{
	//		s = n % 10 + s * 10;
	//		n /= 10;

	//	}
	//	printf("%d\n", s);
	//}

	char str[20] = { 0 };
	scanf("%s", str);
	int n = strlen(str) - 1;
	int t = n;

	int flag = 0;
	while (str[n] == '0')
	{
		n--;
		t = n;
	}

	if (str[0] == '-')
	{
		flag = 1;
		printf("%c", '-');
	}



	for (int i = t; i >= 1; i--)
	{
		printf("%c", str[i]);
	}


	if (flag == 0)
	{
		printf("%c", str[0]);
	}


	return 0;
}